//
//  BindCardTipsViewController.m
//  TaurusXi
//
//  Created by xicheng on 15/12/6.
//  Copyright © 2015年 xicheng. All rights reserved.
//

#import "BindCardTipsViewController.h"
#import "SettingPasswordViewController.h"

@interface BindCardTipsViewController ()
@property (strong, nonatomic)  UILabel *tipLabel;
@property (strong, nonatomic) UIButton *buttonOne;

@property (strong, nonatomic) UIButton *buttonTwo;
@end

@implementation BindCardTipsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
  [self initView];
    // Do any additional setup after loading the view from its nib.
}


-(void)initView{
  self.buttonOne = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 280, 55)];
  self.buttonTwo = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 280, 55)];
  UIImage *buttonImage = ImageWithContentsOfFileWithPng(@"ic_button_@2x");
  buttonImage = [buttonImage resizableImageWithCapInsets:UIEdgeInsetsMake(10, 12, 10, 12) resizingMode:UIImageResizingModeStretch];
  [self.buttonOne setBackgroundImage:buttonImage forState:UIControlStateNormal];
  [self.buttonTwo setBackgroundImage:buttonImage forState:UIControlStateNormal];
  
  UIImage *buttonClickImage = ImageWithContentsOfFileWithPng(@"ic_button_click@2x");
  buttonClickImage = [buttonClickImage resizableImageWithCapInsets:UIEdgeInsetsMake(10, 12, 10, 12) resizingMode:UIImageResizingModeStretch];
  [self.buttonOne setBackgroundImage:buttonClickImage forState:UIControlStateHighlighted];
  [self.buttonTwo setBackgroundImage:buttonClickImage forState:UIControlStateHighlighted];

  self.tipLabel = [[UILabel alloc]init];
  self.tipLabel.textColor =[UIColor yellowColor];
  self.tipLabel.font = [UIFont systemFontOfSize:14];
  
  if (self.setPasswordFlag) {
    self.tipLabel.text = @"您已成功注册金牛座金融账户";
    [self.buttonOne setTitle:@"去设置密码" forState:UIControlStateNormal];
  }else{
    self.tipLabel.text = @"您已成功设置账户相关密码";
    [self.buttonOne setTitle:@"去实名认证" forState:UIControlStateNormal];
  }
  
  
  [self.view addSubview:self.tipLabel];
  [self.tipLabel sizeToFit];
  self.tipLabel.center = CGPointMake(self.deviceWidth/2, self.view.center.y-30);
  
 [self.buttonOne setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  [self.view addSubview:self.buttonOne];
  self.buttonOne.center = CGPointMake(self.deviceWidth/2, self.tipLabel.center.y+80);
  [self.buttonOne addTarget:self action:@selector(clickOne) forControlEvents:UIControlEventTouchUpInside];


  [self.buttonTwo setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  [self.buttonTwo setTitle:@"开始赚钱" forState:UIControlStateNormal];
  [self.view addSubview:self.buttonTwo];
  self.buttonTwo.center = CGPointMake(self.deviceWidth/2, self.buttonOne.center.y+80);
  [self.buttonTwo addTarget:self action:@selector(clickTwo) forControlEvents:UIControlEventTouchUpInside];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)clickOne{
  if(self.setPasswordFlag){
    //跳设置密码界面
    SettingPasswordViewController *target = [[SettingPasswordViewController alloc]initWithNibName:@"SettingPasswordViewController" bundle:nil];
    [self.navigationController pushViewController:target animated:YES];
    
  }else{
    //跳 实名认证界面
  
    SettingPasswordViewController *target = [[SettingPasswordViewController alloc]initWithNibName:@"SettingPasswordViewController" bundle:nil];
    [self.navigationController pushViewController:target animated:YES];

    
  }

  
}

-(void)clickTwo{
  
  
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
